//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) throws InterruptedException {


        int[] arr={1,2,3};
        int size=arr.length;
        MyThread thread1=new MyThread();

        Thread thread2=new Thread(new MyRubable());


        Thread thread3=new Thread(()->{
                System.out.println("第三个线程");

            for (int i = 30; i <40 ; i++) {
                System.out.println(i);

            }

        });

        thread1.start();
        thread1.join();

        System.out.println("hhhh");

        thread2.start();
        thread2.join();

        thread3.start();
        thread3.join();


    }
}


class MyRubable implements Runnable{

    @Override
    public void run() {
        System.out.println("第二个线程");
        for (int i = 10; i <20; i++) {
            System.out.println(i);

        }
    }
}

class MyThread extends Thread{

    public void run(){
        System.out.println("第一个线程");
        for (int i = 1; i <10 ; i++) {
            System.out.println(i);

        }

    }
}







